<?php
/* @var $this ImgsController */
/* @var $model Imgs */

$this->breadcrumbs=array(
	'Shop'=>array('index'),
	$model->title,
);

$this->menu=array(
	array('label'=>'List Shop', 'url'=>array('index')),
	array('label'=>'Create Shop', 'url'=>array('create')),
	array('label'=>'Update Shop', 'url'=>array('update', 'id'=>$model->aid)),
	array('label'=>'Delete Shop', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->aid),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Shop', 'url'=>array('admin')),
);
?>

<h1>#<?php echo $model->aid; ?>
    <a href="<?php
    echo '/index.php/shop/admin';
    ?>" class="l-btn" id=""><span class="l-btn-left"><span class="l-btn-text">返回</span></span></a>
</h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'aid',
		'title',
		'content',
        array(
            'label'=>'图片',
            'type'=>'image',
            'value'=>Yii::app()->baseUrl.$model->img,
        ),
        'url',
//		'cid',
		'type',
        'longitude',
        'latitude',
//		'order',
//		'enabled',
	),
)); ?>
<table id="yw0" class="detail-view"><tbody><tr class="odd">
<tr class="odd"><th>状态</th><td><input type="radio" name="enabled" <?php if($model->enabled==1){echo 'checked="checked" ';}?>value="1"/>开启
            &nbsp;&nbsp;<input type="radio" name="enabled" <?php if($model->enabled==0){echo 'checked="checked" ';}?>value="0"/>关闭</td></tr>
</tbody></table>

<script type="text/javascript">
    $(":radio").change(function(){
        var val = $("input[name='enabled']:checked").val();
        $.ajax({
            url: "/shop/view?id=<?php echo $model->aid;?>",
            success:location.reload(),
            type: 'POST',
            data:({enabled:val}),
            dataType: 'html',
            async:false
        });
    })
</script>